STP is a data transfer protocol that uses small control messages to pre-
arrange data movement. Buffers are allocated at the sending and the
receiving end before the data transmission, allowing full-rate, non-
congesting data flow between the end devices. The control and data may
use different physical media, or may share a single physical medium.
The _r_e_a_d(2) or _r_e_c_v(2) and _w_r_i_t_e(2) or _s_e_n_d(2) system calls should be
used to transfer data over STP sockets. By the very nature of STP, a send
operation on an STP socket must have a corresponding receive at the peer
in order for progress to be made. This is because STP is fundamentally a
``no-copy'' protocol, where transfers are a-priori scheduled to occur
directly from user-space to user-space: there is no intermediate copy of
user-payload into kernel-space. If the user buffer is not aligned on a
double word boundry it may be realigned inside kernel memory resulting in
a bcopy of user data depending on the type of physical NIC.
The _s_e_n_d_m_s_g(2) and _r_e_c_v_m_s_g(2) system calls may be used in a restricted
fashion for scatter-gather operations. The mmmmssssgggg____nnnnaaaammmmeeee and mmmmssssgggg____nnnnaaaammmmeeeelllleeeennnn
fields in the mmmmssssgggghhhhddddrrrr structure are ignored. The mmmmssssgggg____iiiioooovvvv field has the
following restrictions. If the mmmmssssgggg____iiiioooovvvvlllleeeennnn == 1 then the vector (buffer)
being sent must only meet the device alignment restrictions. If mmmmssssgggg____lllleeeennnn
is greater than one then the mmmmssssgggg____iiiioooovvvv[[[[0000]]]]....iiiioooovvvv____bbbbaaaasssseeee must end on a 2222^^^^SSSSTTTT____BBBBUUUUFFFFSSSSZZZZ
boundry. The middle vectors mmmmssssgggg____iiiioooovvvv[[[[1111]]]]....iiiioooovvvv____bbbbaaaasssseeee thru mmmmssssgggg____iiiioooovvvv[[[[mmmmssssgggg____iiiioooovvvvlllleeeennnn----
2222]]]]....iiiioooovvvv____bbbbaaaasssseeee must be of length 2222^^^^SSSSTTTT____BBBBUUUUFFFFSSSSZZZZ if they exist. The last vector
mmmmssssgggg____iiiioooovvvv[[[[mmmmssssgggg____iiiioooovvvvlllleeeennnn----1111]]]]....iiiioooovvvv____bbbbaaaasssseeee must start on a 2222^^^^SSSSTTTT____BBBBUUUUFFFFSSSSZZZZ boundy. The
first, middle and last vector must also meet the device alignment
restrictions. The msghdr may contain zero length vectors which are
removed before sending.
STP supports several socket options which can be tested with
_g_e_t_s_o_c_k_o_p_t(_2) and manipulated with _s_e_t_s_o_c_k_o_p_t(_2). These options are
defined in <_n_e_t_i_n_e_t/_s_t._h>.
ST_CTS_OUTSTD
Tells the ST socket how many outstanding clear-to-sends (CTS-es) the
initiator of a write()/send() can handle. Other things remaining
equal, increasing this value pipelines the data transfer, and is
expected to increase bandwidth. The default value for ST sockets is
128. The data type for the {set|get}socketopt is an unsigned short.
_ssss_eeee_nnnn_ssss_eeee _ffff_oooo_rrrr _tttt_hhhh_eeee _GGGG_iiii_gggg_aaaa_bbbb_yyyy_tttt_eeee _SSSS_yyyy_ssss_tttt_eeee_mmmm _NNNN_eeee_tttt_wwww_oooo_rrrr_kkkk _hhhh_aaaa_rrrr_dddd_wwww_aaaa_rrrr_eeee _oooo_nnnn_llll_yyyy_...._]]]] The data type
_oooo_nnnn_llll_yyyy_...._]]]] The data type for the {set|get}socketopt is an unsigned
char.
ST_USE_APPEND_PORT
This allows the user to specify to the STP stack to use an append
data port. This parameter can be 0 to use normal port or 1 to have
it be an append port. _[[[[_TTTT_hhhh_iiii_ssss _pppp_aaaa_rrrr_aaaa_mmmm_eeee_tttt_eeee_rrrr _mmmm_aaaa_kkkk_eeee_ssss _ssss_eeee_nnnn_ssss_eeee _ffff_oooo_rrrr _tttt_hhhh_eeee _GGGG_iiii_gggg_aaaa_bbbb_yyyy_tttt_eeee
_SSSS_yyyy_ssss_tttt_eeee_mmmm _NNNN_eeee_tttt_wwww_oooo_rrrr_kkkk _hhhh_aaaa_rrrr_dddd_wwww_aaaa_rrrr_eeee _oooo_nnnn_llll_yyyy_...._]]]] The data type for the
{set|get}socketopt is an unsigned char.
ST_MAP_PORT_DIRECT
This allows the user to specify a hardware port to use directly
instead of having the STP stack assign one. This parameter can be 0
to let the STP stack choose a hardware port or 1 to have it user
specified. The user specified value is the port to which the socket
is bound. _[[[[_TTTT_hhhh_iiii_ssss _pppp_aaaa_rrrr_aaaa_mmmm_eeee_tttt_eeee_rrrr _mmmm_aaaa_kkkk_eeee_ssss _ssss_eeee_nnnn_ssss_eeee _ffff_oooo_rrrr _tttt_hhhh_eeee _GGGG_iiii_gggg_aaaa_bbbb_yyyy_tttt_eeee _SSSS_yyyy_ssss_tttt_eeee_mmmm
_NNNN_eeee_tttt_wwww_oooo_rrrr_kkkk _hhhh_aaaa_rrrr_dddd_wwww_aaaa_rrrr_eeee _oooo_nnnn_llll_yyyy_...._]]]] The data type for the {set|get}socketopt is